package com.ldj.controller;


import com.ldj.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
public class HelloWorldController {

    /**
     * service
     */
    @Autowired
    private UserService userService;

    @RequestMapping(value = "/test")
    @ResponseBody
    public String testSay(@RequestParam(value = "name",defaultValue = "") String name){
        StringBuffer sb = new StringBuffer();
        sb.append("Dubbo: ").append(userService.sayHello(name));
        return sb.toString();
    }
}
